<?php
namespace Admin\Model;
use Think\Model;
class CommonModel extends Model {
    /**
    +----------------------------------------------------------
     * 根据条件禁用表数据
    +----------------------------------------------------------
     * @access public
    +----------------------------------------------------------
     * @param array $options 条件
    +----------------------------------------------------------
     * @return boolen
    +----------------------------------------------------------
     */
    public function forbid($options,$field='status'){

        if(FALSE === $this->where($options)->setField($field,0)){
            $this->error =  L('_OPERATION_WRONG_');
            return false;
        }else {
            return True;
        }
    }


    /**
    +----------------------------------------------------------
     * 根据条件恢复表数据
    +----------------------------------------------------------
     * @access public
    +----------------------------------------------------------
     * @param array $options 条件
    +----------------------------------------------------------
     * @return boolen
    +----------------------------------------------------------
     */
    public function resume($options,$field='status'){
        if(FALSE === $this->where($options)->setField($field,1)){
            $this->error =  L('_OPERATION_WRONG_');
            return false;
        }else {
            return True;
        }
    }

    function executeU8Procedur($pName, $parName, $sqlTyle,$is_output = false,$is_null = false ,$maxlen ) {
        return $this->db->executeU8Procedur($pName, $parName, $sqlTyle,$is_output,$is_null,$maxlen);
    }



}